package com.jsgt.greekfire.ui.mine.sermoncommunity.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.fhx.core.base.BaseAdapter
import com.fhx.core.base.BaseViewHolder
import com.jsgt.greekfire.R
import com.jsgt.greekfire.ui.mine.sermoncommunity.MyCommunityItem


class SermonCommunityAdapter : BaseAdapter<MyCommunityItem>() {


    inner class VH(itemView: View) : BaseViewHolder(itemView) {

        var item_Wallet_name1: TextView? = null
        var item_Number_communities: TextView? = null
        var item_Community_performance: TextView? = null
        var item_Wallet_address: TextView? = null
        var item_Creation_time: TextView? = null

        init {
            item_Wallet_name1 = itemView.findViewById(R.id.item_Wallet_name1)
            item_Number_communities = itemView.findViewById(R.id.item_Number_communities)
            item_Community_performance = itemView.findViewById(R.id.item_Community_performance)
            item_Wallet_address = itemView.findViewById(R.id.item_Wallet_address)
            item_Creation_time = itemView.findViewById(R.id.item_Creation_time)
        }


        fun bindData(bean: MyCommunityItem) {

            item_Wallet_name1?.text = bean.walletName.toString()
            item_Number_communities?.text = bean.communityNumb.toString()
            item_Community_performance?.text = bean.communityPerformance.toString()
            item_Wallet_address?.text = bean.walletAddress.toString()
            item_Creation_time?.text = bean.createTime.toString()

        }
    }

    override fun provideViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder? {
        val view = LayoutInflater.from(parent.context)
            .inflate(R.layout.item_sermon_community, parent, false)
        return VH(view)
    }

    override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
        val viewHolder = holder as VH
        viewHolder.bindData(dataList()[position])
    }


}